#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.forms.widgets import TextInput

class AutoCompleteInput(TextInput):
    def __init__(self, attrs = None, choice_function = None):
        """
        Takes a choice_function which returns a list of choices for a string
        """
        super(AutoCompleteInput, self).__init__(attrs)
        self.choice_function = choice_function
        
    def render(self):
        # Idee: classe setzen, die funktion preis gibt, auf die widget sich bezieht?
        class Media:
            js = ('/static/scripts/own/autocomplete.js', )